package com.sau.pixelcart.controller;

import com.sau.pixelcart.common.result.Result;
import com.sau.pixelcart.domain.vo.DashboardVO;
import com.sau.pixelcart.service.DashboardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 首页看板
 */
@Slf4j
@RestController
@RequestMapping("/dashboard")
public class DashboardController {

    @Autowired
    private DashboardService dashboardService;

    /**
     * 首页看板查询
     * @return
     */
    @GetMapping
    public Result dashboard(){
        log.info("首页看板查询...");
        DashboardVO dashboardVO = dashboardService.dashboardView();
        return Result.success(dashboardVO);
    }
}
